var common = require('../../utils/common.js');
var ajax = require('../../utils/ajax.js');
var util = require('../../utils/util.js');
var app = getApp();

Page({
	data: {
		dataLoaded: false
	},

	onLoad(options) {
		this._videoId = options.videoId;
		this._getVideo();
	},

	_getVideo() {
		var _self = this;

		ajax.G('/openapi/CHome/article_detail', {
			artId: _self._videoId,
		}, function(data) {
			var d = data['result'];

			_self.setData({
				dataLoaded: true,
				title: d.title,
				date: d.create_time,
				videoData: {
					url: d.video_url,
				},
				summary: d.video_summary
			});
		});

	},
});